{% extends "base.html" %}
{% block content %}
  <h1>Messages</h1>
  <ul>
   {% for greeting in greetings %}
      {% if greeting.author %}
      <li style="list-style:square;"><b>{{ greeting.author.nickname }}</b> {{ greeting.date|date:"Y-m-d h:i:s" }} wrote:</li>
      {% else %}
       <li style="list-style:square;">An anonymous person {{ greeting.date|date:"Y-m-d h:i:s" }} wrote:</li>
      {% endif %}
      <li style="list-style-type:none; padding-left:10px; padding-bottom:10px;">{{ greeting.content|escape }}</li>
    {% endfor %}
  </ul>
  <h1>Leave a Message</h1>
    <form action="/sign" method="post" style="padding-left:40px;">
      <div><textarea name="content" rows="3" cols="60"></textarea></div>
      <div><input type="submit" value="Send">
      <span style="padding-left:10px;"><button onclick="location.href='{{ url }}'" type="button" name="{{ url_linktext }}">{{ url_linktext }}</button>
      </div>
    </form>
{% endblock %}
